//
//  introView.m
//  UI_A项目
//
//  Created by dlios on 15-1-21.
//  Copyright (c) 2015年 songCheng. All rights reserved.
//

#import "introView.h"

@implementation introView


- (void)dealloc
{
    [_introLabel release];
    [_titleLabel release];
    [_tagsLabel release];
    [_nicknameLabel release];
    [super dealloc];
}


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubView];
    }
    return self;
}


- (void)createSubView
{
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(25, 20, 300, 30)];

    [self addSubview:self.titleLabel];
    [_titleLabel release];
    
    self.nicknameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.titleLabel.frame.origin.x, self.titleLabel.frame.origin.y + 40, self.titleLabel.frame.size.width, self.titleLabel.frame.size.height)];

    [self addSubview:self.nicknameLabel];
    [_nicknameLabel release];
    
    self.tagsLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.nicknameLabel.frame.origin.x, self.nicknameLabel.frame.origin.y + 40, self.nicknameLabel.frame.size.width, self.nicknameLabel.frame.size.height)];
 
    [self addSubview:self.tagsLabel];
    [_tagsLabel release];
    
    self.scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(self.tagsLabel.frame.origin.x - 24, self.tagsLabel.frame.origin.y + 40, 330, 200)];
    [self addSubview:self.scrollView];
    [_scrollView release];
    
//    self.scrollView.contentSize = CGSizeMake(0, 500);
    self.introLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.tagsLabel.frame.origin.x, self.tagsLabel.frame.origin.y + 40, 335, 200)];

    
    self.introLabel.numberOfLines = 0;
    
    [self addSubview:self.introLabel];
    [_introLabel release];
    
    
    
    
}

- (void)setModel:(ClassModel *)model
{
    if (_model != model) {
        [_model release];
        _model = [model retain];
    }
    self.titleLabel.text = [NSString stringWithFormat:@"专辑名称: %@", model.title];
    self.tagsLabel.text = [NSString stringWithFormat:@"标签: %@", model.tags];
    self.introLabel.text = [NSString stringWithFormat:@"简介: %@", model.intro1];
    self.nicknameLabel.text = [NSString stringWithFormat:@"创建者: %@", model.nickname1];
    
    
}




/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
